package com.ddzh.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ddzh.pojo.CheckItem;
import com.ddzh.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import javax.annotation.security.PermitAll;
import java.util.List;

public interface UserMapper extends BaseMapper<User> {

    @Select("select * from user_t where username=#{username}")
    User findByUsername(@Param("username") String userName);

    @Select("select ut.username\n" +
            "from user_role_t urt left join user_t ut on urt.user_id=ut.id\n" +
            "where urt.role_id=#{roleId}; ")
    List<String> findUserNameByURoleId(@Param("roleId")Long roleId);

//    @Select("select cit.* from check_group_item_t cgit inner  join check_item_t cit on cgit.item_id = cit.id\n" +
//            "where cgit.group_id=#{groupId}")
//    List<User> getDetail(@Param("groupId") Long groupId);
//
//    @Select("select * from check_item_t where name=#{name} and is_delete=0")
//    CheckItem findByName(@Param("name") String name);
//
//
//    @Select("select * from check_item_t where code=#{code} and is_delete=0")
//    CheckItem findByCode(@Param("code") String code);
}
